package packge.io;

import java.io.*;

class IOTest4 {
	public static void main(String st[]) throws Exception {
		if (st.length != 2) {
			System.out.println("Enter fileName append as CLA");
			System.exit(0);
		}
		String fileName = st[0];
		boolean b1 = new Boolean(st[1]).booleanValue();
		System.out.println("Enter data");
		FileOutputStream fos = new FileOutputStream(fileName, b1);
		while (true) {
			int x = System.in.read();
			if (x == 13)
				break;
			System.out.print((char) x);
			fos.write(x);
		}
	}
}